<table id="items" class="datatable table table-striped table-bordered" >
  <thead>
    <tr>
      <th>Name</th>
      <th>Qty</th>
      <th>Model</th>
      <th>Status</th>
      <th>Condition</th>
      <th>Location</th>
      <th>Last Inspection</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% items.each do |item| %>
      <tr>
        <td><%= link_to item.name, item_path(item) %></td>
        <td><%= item.qty %></td>
        <td><%= "#{item.brand} #{item.model}" %></td>
        <td><%= item_status_label(item) %></td>
        <td><%= item_condition_label(item) %></td>
        <td><%= item.location.name if item.location %></td>
        <td><%= item.last_inspection_date.nil? ? "None Completed" : item.last_inspection_date %></td>
        <td><%= table_button_link 'Edit', edit_item_path(item) unless cannot? :edit, item %></td>
      </tr>
    <% end %>
  </tbody>
</table>
